<script type="text/javascript"><!--//--><![CDATA[//><!--

	
    $(document).ready(function() {

    	var id_invoice = '<?php echo $id_invoice ?> ';
		$('#id_invoice').setval(id_invoice);

        // Setup Form
		$('#form_master').setupForm([
            { name: 'kode_kontrak', type: 'text', size: 'medium', maxlength: 10 },
			{ name: 'no_invoice', type: 'text', size: 'medium', maxlength: 100}
        ], <?php echo json_encode($data); ?>);
        
        //$('#id_custom').setval(id_custom_auto);

		/*$('#kode_kontrak').keyup(function() {
			$('#id_custom').setval(id_custom_auto);
		});*/
		
		// Set Action Button
		var buttons = [{ label: 'Save', icon: 'save', onclick: function() { 
							$('#form_master').submitForm(	'/'+controller+'/ajax_post', 
															{	detail:[{ table: 'dtl_sample2', field:['harga','uraian','id_custom_detail']}] 
																//onComplete : function(data){ eval('oData = '+data); loadPage('/'+controller+'/edit/?no_tagihan_listrik='+(oData.genid!='' ? oData.genid : $('#no_tagihan_listrik').getval())); }
															} 
														);
							//$('#id_custom').setval(id_custom_auto);
						}},
					   { label: 'Close', icon: 'cancel', onclick: function() { loadPage('/'+controller+'/Index'); } }];
		setAction(buttons);
		
		// Create Tab
		$('#tt').tabs({ border:false });  
		
		// Focus at First Object
		$('#form_master').focusFirst();
    });
//--><!]]></script>

<div id="form_master_message" style="display:none;"></div>

<table class="tb_form" style="display:none;" cellpadding="0" cellspacing="0">
<tr>
	<td>
		<input id="id_invoice" name="id_invoice" type="hidden" />
	</td>
</tr>
<tr>
    <td class="label">Kode Kontrak</td>
    <td><input id="kode_kontrak" /><!-- <input id="id_custom" name="id_custom" type="hidden"> --></td>
</tr>
<tr>
    <td class="label">No Invoice</td>
    <td><input id="no_invoice" /></td>
</tr>
</table>

<div id="tt" class="easyui-tabs" style="min-height:400px;">  
    <div title="Detail Uraian" style="overflow:auto;padding:10px;">  
    	<?php require_once('formCustom.php'); ?>
    </div>   
</div> 